package com.zhy.http.okhttp.request;

import com.zhy.http.okhttp.utils.Exceptions;
import java.util.Map;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.Request.Builder;
import okhttp3.RequestBody;

public class PostStringRequest extends OkHttpRequest
{
  private static MediaType MEDIA_TYPE_PLAIN = MediaType.parse("text/plain;charset=utf-8");
  private String content;
  private MediaType mediaType;

  public PostStringRequest(String paramString1, Object paramObject, Map<String, String> paramMap1, Map<String, String> paramMap2, String paramString2, MediaType paramMediaType)
  {
    super(paramString1, paramObject, paramMap1, paramMap2);
    this.content = paramString2;
    this.mediaType = paramMediaType;
    if (this.content == null)
      Exceptions.illegalArgument("the content can not be null !");
    if (this.mediaType == null)
      this.mediaType = MEDIA_TYPE_PLAIN;
  }

  protected Request buildRequest(Request.Builder paramBuilder, RequestBody paramRequestBody)
  {
    return paramBuilder.post(paramRequestBody).build();
  }

  protected RequestBody buildRequestBody()
  {
    return RequestBody.create(this.mediaType, this.content);
  }

  public String toString()
  {
    return super.toString() + ", requestBody{content=" + this.content + "} ";
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.zhy.http.okhttp.request.PostStringRequest
 * JD-Core Version:    0.6.2
 */